package response

import (
	"wzgames/internal/constant"
	"wzgames/internal/model/mcomm"
	"wzgames/pkg/utils/stringutil"
)

func IfWin(r mcomm.GameResult) bool {
	if r == mcomm.GameResult_GameWin {
		return true
	}
	return false
}

// TrimAmtZeros 移除金额后面多余的0
func TrimAmtZeros(amt string) string {
	newAmt := stringutil.RightTrim(amt, constant.ZeroStr)
	if newAmt == constant.EmptyStr || newAmt == constant.ZeroDot {
		return constant.ZeroStr
	}
	newAmt = stringutil.RightTrim(newAmt, constant.Dot)

	return newAmt
}
